package com.code.google.wormon;

import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;

import javax.swing.ImageIcon;

import com.code.google.wormon.base.GameObject;

public class WormonVitamin implements GameObject {
	private Image image;
	private Rectangle shape;
	private boolean markForRemove = false;

	public WormonVitamin(Integer x, Integer y) {
		super();
		image = new ImageIcon(getClass().getClassLoader().getResource("com/code/google/wormon/resources/money.png")).getImage();
		shape = new Rectangle(x, y, image.getWidth(null), image.getHeight(null));
	}

	@Override
	public void collided(GameObject other) {
		markForRemove = true;
	}

	@Override
	public void react(KeyEvent keyEvent) {
	}

	@Override
	public void draw(Graphics2D g2d) {
		g2d.drawImage(image, shape.x, shape.y, null);
	}

	@Override
	public Rectangle getBounds() {
		return shape;
	}

	@Override
	public void doLogic() {
		// do nothing
	}

	public boolean isMarkForRemove() {
		return markForRemove;
	}

	@Override	
	public int getPosX(){
		return shape.x;
	}
	
	@Override
	public int getPosY(){
		return shape.y;
	}
}
